/*
 * @Author: yanjikun
 * @Date: 2022-05-27 13:41:23
 * @LastEditors: yanjikun
 * @LastEditTime: 2022-06-06 09:55:24
 * @Description: file content
 */

import { RouteRecordRaw } from 'vue-router'
import RouterView from '@/layouts/routerView/index.vue'

export const notFound: RouteRecordRaw = {
  path: '/:pathMatch(.*)*',
  redirect: '/error/404',
  name: 'NotFound',
  meta: {
    title: '404',
    hidden: true,
  },
  component: () => import(/* webpackChunkName: "error" */ '@/views/error/404.vue'),
}

export const errorRoute: RouteRecordRaw = {
  path: '/error',
  name: 'error',
  redirect: '/error/404',
  component: RouterView,
  meta: {
    title: '错误页',
  },
  children: [
    {
      path: '404',
      name: '404',
      meta: {
        title: '404',
        hidden: true,
      },
      component: () => import(/* webpackChunkName: "error" */ '@/views/error/404.vue'),
    },
  ],
}

export default [errorRoute, notFound]
